package com.clothes.aweiDoExercises.satoken;

import cn.dev33.satoken.interceptor.SaInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * SaToken注解拦截器(为了支持权限注解)
 */
@Configuration
public class SaTokenConfigure implements WebMvcConfigurer {
    //注册sa-token的拦截器,使用注解鉴权模式
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        
        registry.addInterceptor(new SaInterceptor()).addPathPatterns("/**");
    }
}